<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datetimepicker\DateTimePicker;

/* @var $this yii\web\View */
/* @var $model backend\models\MActivityShowSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<style>
.mactivity-show-search .form-group{padding:4px;}
</style>
<div class="mactivity-show-search">
    
    <?php
     \Yii::$container->set(\yii\widgets\ActiveField::className(), ['template' => "{label}\n{input}\n{hint}"]);
     $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
        'options' => ['class' => 'form-inline'],
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'c_name') ?>
    
    <?=$form->field($model, 'c_status')->dropDownList(['' => '全部', '下线', '上线']) ?>
    
    <?= $form->field($model, 'c_begin')->widget(DateTimePicker::className(), 
        [
        'template'=>"{input}{reset}{button}",
        'clientOptions' => [
            'autoclose' => true,
            'linkFormat' => 'yyyy-MM-dd', // if inline = true
            'format' => 'yyyy-mm-dd', // if inline = false
            'todayBtn' => true,
            'pickerPosition'=>"bottom-left",
            'language'=>'zh-CN',
            'minView'=>'month'
        ]    
    ])?>
    
    <?= $form->field($model, 'c_end')->widget(DateTimePicker::className(), 
        [
        'template'=>"{input}{reset}{button}",
        'clientOptions' => [
            'autoclose' => true,
            //'linkFormat' => 'yyyy-MM-dd', // if inline = true
            'format' => 'yyyy-mm-dd', // if inline = false
            'todayBtn' => true,
            'pickerPosition'=>"bottom-left",
            'language'=>'zh-CN',
            'minView'=>'month'
        ]    
    ])?>
    <div class="form-group">
        <?= Html::submitButton('搜索', ['class' => 'btn btn-primary']) ?>
    </div>
    <div style="float:right;margin: 4px 20px 0 0;">
     <?= Html::a('添加活动', ['create'], ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
